
#include "GiftSenderConcrete.h"
#include <iostream>

using namespace npProxy;


//other constructors
GiftSenderConcrete::GiftSenderConcrete(weak_ptr<Girl> girl) : GiftSender(girl)
{

}

//public methods
void GiftSenderConcrete::sendDolls() throw(ErrorEnum)
{
    if (shared_ptr<Girl> girl = this->getGirl().lock())
    {
        cout << "xingbao gives dolls to " << girl->getName() << endl;
    }
    else
    {
        throw ErrorEnum::NoGirlToSendException;
    }
}

void GiftSenderConcrete::sendFollows() throw(ErrorEnum)
{
    if (shared_ptr<Girl> girl = this->getGirl().lock())
    {
        cout << "xingbao gives follows to " << girl->getName() << endl;
    }
    else
    {
        throw ErrorEnum::NoGirlToSendException;
    }
}

void GiftSenderConcrete::sendChocolates() throw(ErrorEnum)
{
    if (shared_ptr<Girl> girl = this->getGirl().lock())
    {
        cout << "xingbao gives chocolates to " << girl->getName() << endl;
    }
    else
    {
        throw ErrorEnum::NoGirlToSendException;
    }
}

//protected methods

//private methods

//static part

//others
